package com.sky.mapper;

import com.sky.entity.SetmealDish;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author iTaotao
 * @version 1.0.0
 * @ClassName SetmealDishMapper.java
 * @Description
 * @createTime 2023年07月28日 20:38:00
 */
@Mapper
public interface SetmealDishMapper {
    /**
     * 插入
     *
     * @param setmealDishes setmeal菜
     */
    void insert(List<SetmealDish> setmealDishes);

    /**
     * deletesetmeal道菜套餐id
     *
     * @param ids id
     */
    void deletesetmealDishBySetMealId(List<Long> ids);

    /**
     * selete套餐byid
     *
     * @param id id
     * @return {@link List}<{@link SetmealDish}>
     */
    @Select("select * from setmeal_dish where id = #{id}")
    List<SetmealDish> seleteSetMealByid(Long id);

    /**
     * 选择通过菜id
     *
     * @param ids id
     * @return {@link Integer}
     */
    Integer selectByDishId(List<Long> ids);

    /**
     * 选择套餐id
     *
     * @param setmealId setmeal id
     * @return {@link SetmealDish}
     */
    @Select("select * from setmeal_dish where setmeal_id = #{setmealId}")
    SetmealDish selectBySetMealId(Long setmealId);
}
